<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class UserSecurity extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //   `user_id` int(11) NOT NULL COMMENT '用户ID',
        //  `security_user_id` int(11) NOT NULL COMMENT '安保用户ID',
        //  `position` point NOT NULL COMMENT '用户位置',
        //  `status` tinyint(1) NOT NULL COMMENT '安保状态，1：寻求安保，2：安保中，3：安保结束',
        Schema::dropIfExists('user_security');
        Schema::create('user_security', function (Blueprint $table){
            $table->comment = "用户安保需求";
            $table->increments('id')->comment("ID");

            $table->integer('user_id')->comment("用户ID");
            $table->integer('security_user_id')->comment("安保用户ID");
            $table->point('position')->comment("用户位置");
            $table->tinyInteger("status")->comment("安保状态");

            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
